import React from "react";
import ReactDOM from "react-dom/client";
import routes from "./router";
import { BrowserRouter, useRoutes } from "react-router-dom";
import "../global.less";

function App() {
  console.log("app load");

  const elements = useRoutes(routes);
  return elements;
}

const root = ReactDOM.createRoot(document.body as HTMLElement);
root.render(
  <React.StrictMode>
    <BrowserRouter>
      {/* 用于支持 内部 <Link>，与它类似的还有 <NavLink>，区别是匹配路径会高亮  */}
      {/* <RouterAuth /> */}
      <App />
    </BrowserRouter>
  </React.StrictMode>
);
